package com.xique.community.api;

import com.xique.common.core.constant.ServiceNameConstants;
import com.xique.common.core.domain.R;
import com.xique.community.api.factory.RemoteCommunityUserFallbackFactory;
import com.xique.community.api.model.CommunityUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * 用户服务
 * 
 * @author xique
 */
@FeignClient(contextId = "remoteCommunityUserService", value = ServiceNameConstants.COMMUNITY_BIZ_SERVICE, fallbackFactory = RemoteCommunityUserFallbackFactory.class)
public interface RemoteCommunityUserService
{
    /**
     * 通过用户id查询用户信息
     *
     * @param id 用户ID
     * @return 结果
     */
    @GetMapping(value = "/user/{id}")
    R<CommunityUser> getUserInfo(@PathVariable("id") Long id);

    /**
     * 通过用户ids查询用户列表信息
     * @author shd
     * @date 2021/9/24 11:11
     * @param userIds
     * @return com.xique.common.core.domain.R<java.util.List<com.xique.community.api.model.CommunityUser>>
     */
    @GetMapping(value = "user/list")
    R<List<CommunityUser>> getUserList(@Param("userIds") List<Long> userIds);
}
